import request from '@/utils/request'

export function getGoodsListApi(data) {
  return request({
    url: '/commodity/pageInfo',
    method: 'post',
    data
  })
}

export function saveGoodsApi(data) {
  return request({
    url: '/commodity/save',
    method: 'post',
    data
  })
}

export function changeGoodsStateApi(data) {
  return request({
    url: '/commodity/changeState',
    method: 'post',
    data
  })
}

export function deleteGoodsApi(data) {
  return request({
    url: '/commodity/batchDelete',
    method: 'post',
    data
  })
}

export function getGoodsDetailApi(id) {
  return request({
    url: `/commodity/detail/${id}`,
    method: 'get',
  })
}

export function getOrderListApi(data) {
  return request({
    url: `/commodityOrder/pageInfo`,
    method: 'post',
    data
  })
}

export function editOrderApi(data) {
  return request({
    url: `/commodityOrder/edit`,
    method: 'post',
    data
  })
}

export function getOrderDetailApi(id) {
  return request({
    url: `/commodityOrder/detail/${id}`,
    method: 'get',
  })
}